<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [13, 234, 34, 35, 4, 5, 4, 5, 345, 543, 45];
        var arr2 = [];
        var j = 0;
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] >= 30) {
                //方法一
                arr2[j++] = arr[i];
                //方法二
                // arr2[arr.length] = arr[i];
            }
        }
        console.log(arr2);
    </script>
</head>

<body>

</body>

</html>